// export const BASE_URL = "http://127.0.0.1:8080";

export const BASE_URL = "https://frp-fan.top:57545";

export function checkLogin(result, itemId) {
	if (result.code === 401) {
		uni.showToast({
			title: result.msg,
			icon: 'none',
			duration: 2000
		})
		uni.redirectTo({
			url: '/pages/login/login?itemId=' + itemId
		})
	}
}

const Map = {}

export function getStore(key) {
	return Map[key]
}

export function setStore(key, value) {
	Map[key] = value
}


// dev 为本地请求, prod 为线上请求
export const env = "dev"

export const cloudConfig = (header = {}) => {
	return {
		"config": {
			"env": "prod-5g9djfd0fa7fe87b"
		},
		"method": "GET",
		"header": {
			"X-WX-SERVICE": "springboot-yhah",
			...header
		},

	}
}

